package cn.tedu.boot4.mapper;

import cn.tedu.boot4.entity.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EmpMapper {
    @Insert("insert into myemp1 values(null,#{name},#{salary},#{job})")
    void insert(Emp emp);

    @Select("select * from myemp1")
    List<Emp> select();


    @Update("update myemp1 set name=#{name},salary=#{salary},job=#{job} where id=#{id}")
    void update(Emp emp);

    @Select("select * from myemp1 where id=#{id}")
    Emp selectById(int id);

    @Delete("delete from myemp1 where id=#{id}")
    void deleteById(int id);
}
